package com.baseweb.webadmin.core.model.mapper;

import com.baseweb.webadmin.core.model.pojo.ByUserExampleDetail;
import com.baseweb.webadmin.core.model.pojo.ByUserExampleDetailExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

public interface ByUserExampleDetailMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_example_detail
     *
     * @mbggenerated Tue Apr 11 23:54:55 CST 2017
     */
    int countByExample(ByUserExampleDetailExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_example_detail
     *
     * @mbggenerated Tue Apr 11 23:54:55 CST 2017
     */
    int deleteByExample(ByUserExampleDetailExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_example_detail
     *
     * @mbggenerated Tue Apr 11 23:54:55 CST 2017
     */
    @Delete({
        "delete from by_user_example_detail",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_example_detail
     *
     * @mbggenerated Tue Apr 11 23:54:55 CST 2017
     */
    @Insert({
        "insert into by_user_example_detail (example_id, user_id, ",
        "img_url, name, status, ",
        "create_time, ",
        "update_time)",
        "values (#{exampleId,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, ",
        "#{imgUrl,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
        "#{createTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler}, ",
        "#{updateTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(ByUserExampleDetail record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_example_detail
     *
     * @mbggenerated Tue Apr 11 23:54:55 CST 2017
     */
    int insertSelective(ByUserExampleDetail record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_example_detail
     *
     * @mbggenerated Tue Apr 11 23:54:55 CST 2017
     */
    List<ByUserExampleDetail> selectByExample(ByUserExampleDetailExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_example_detail
     *
     * @mbggenerated Tue Apr 11 23:54:55 CST 2017
     */
    @Select({
        "select",
        "id, example_id, user_id, img_url, name, status, create_time, update_time",
        "from by_user_example_detail",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    ByUserExampleDetail selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_example_detail
     *
     * @mbggenerated Tue Apr 11 23:54:55 CST 2017
     */
    int updateByExampleSelective(@Param("record") ByUserExampleDetail record, @Param("example") ByUserExampleDetailExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_example_detail
     *
     * @mbggenerated Tue Apr 11 23:54:55 CST 2017
     */
    int updateByExample(@Param("record") ByUserExampleDetail record, @Param("example") ByUserExampleDetailExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_example_detail
     *
     * @mbggenerated Tue Apr 11 23:54:55 CST 2017
     */
    int updateByPrimaryKeySelective(ByUserExampleDetail record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_example_detail
     *
     * @mbggenerated Tue Apr 11 23:54:55 CST 2017
     */
    @Update({
        "update by_user_example_detail",
        "set example_id = #{exampleId,jdbcType=INTEGER},",
          "user_id = #{userId,jdbcType=INTEGER},",
          "img_url = #{imgUrl,jdbcType=VARCHAR},",
          "name = #{name,jdbcType=VARCHAR},",
          "status = #{status,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(ByUserExampleDetail record);
}